package dp.gr03.payroll.classifications;

import java.util.ArrayList;
import java.util.GregorianCalendar;

import dp.gr03.payroll.Paycheck;
import dp.gr03.payroll.payrollDomain.PaymentClassification;

public class CommissionedClassification implements PaymentClassification
{
    protected double commissionRate;
    protected double salary;
    protected ArrayList<SalesReceipt> salesReceipts;

    public CommissionedClassification(double salary, double commissionRate)
    {
        this.commissionRate = commissionRate;
        this.salary = salary;
        salesReceipts = new ArrayList<SalesReceipt>();
    }

    public ArrayList<SalesReceipt> getSalesReceipts()
    {
        return salesReceipts;
    }

    public double getCommissionRate()
    {
        return commissionRate;
    }

    public double getSalary()
    {
        return salary;
    }
    
    public SalesReceipt getSalesReceipt(GregorianCalendar date)
    {
        for (SalesReceipt r : salesReceipts)
        {
            if (r.getDate().equals(date))
                return r;
        }

        return null;
    }

    public void addSalesReceipt(SalesReceipt salesReceipt)
    {
    	salesReceipts.add(salesReceipt);
    }

    @Override
    public double calculatePay(Paycheck pc)
    {
        // TODO Auto-generated method stub
        return 0;
    }

}
